package tech.aistar.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2022/8/11 1:52 下午
 */
public class ConfigUtil {
    private static Properties prop = new Properties();

    static{
        InputStream in= Thread.currentThread().getContextClassLoader().getResourceAsStream("config/dbConfig.properties");
        try {
            prop.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getValue(String key){
        return prop.getProperty(key);
    }

    public static void main(String[] args) {
        System.out.println(getValue("username"));
    }
}
